<?
	include("xcoord.php");

	$url = substr(strstr($_SERVER['REQUEST_URI'],".php"),5);

	$attrs = explode("/", $url);
	$cmd = $attrs[0];
	$keyvals = explode("=", $attrs[1]);

	$key = $keyvals[0];
	$value = $keyvals[1];


	$xcoord = new xcoord("myspace");

	if($cmd=="write") {
		$xcoord->write($key, $value);
		echo "write ".$key." = ".$value."\n<br>";
	}
	else if($cmd=="read") {
		$value_by_read = $xcoord->read($key);
		echo "read ".$key." = ".$value_by_read."\n<br>";
	}
	else if($cmd=="take") {
		$value_by_take = $xcoord->take($key);
		echo "take ".$key." = ".$value_by_take."\n<br>";
	}
	else {
		echo "<font color=red>Usages : /coord.php/&lt;cmd&gt;/&lt;key&gt;=&lt;value&gt;/</font>"."\n<br>";
		echo "<i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;cmd&gt; : &nbsp;&nbsp;[write|read|take]</i>"."\n<br><br>";
		echo "ex1) /coord.php/write/woorung=this is coord's example"."\n<br>";
		echo "ex2) /coord.php/read/woorung"."\n<br>";
		echo "ex3) /coord.php/take/woorung"."\n<br>";
		exit;
	}
?>
